{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "37b89511",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b3fde6a2",
   "metadata": {},
   "outputs": [],
   "source": [
    "column_names= ['id', 'name', 'age', 'weight','m0006',\n",
    " 'm0612','m1218','f0006','f0612','f1218']\n",
    "df = pd.read_csv(\"./data/patient_heart_rate.csv\",names=column_names)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "80030ad4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>Mickéy Mousé</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>Donald Duck</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>Mini Mouse</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>Scrooge McDuck</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>Pink Panther</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>Huey McDuck</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>Dewey McDuck</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>Scööpy Doo</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>Huey McDuck</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id            name   age      weight m0006 m0612 m1218 f0006 f0612 f1218\n",
       "0  1.0    Mickéy Mousé  56.0       70kgs    72    69    71     -     -     -\n",
       "1  2.0     Donald Duck  34.0   154.89lbs     -     -     -    85    84    76\n",
       "2  3.0      Mini Mouse  16.0         NaN     -     -     -    65    69    72\n",
       "3  4.0  Scrooge McDuck   NaN       78kgs    78    79    72     -     -     -\n",
       "4  5.0    Pink Panther  54.0  198.658lbs     -     -     -    69   NaN    75\n",
       "5  6.0     Huey McDuck  52.0      189lbs     -     -     -    68    75    72\n",
       "6  7.0    Dewey McDuck  19.0       56kgs     -     -     -    71    78    75\n",
       "7  8.0      Scööpy Doo  32.0       78kgs    78    76    75     -     -     -\n",
       "8  NaN             NaN   NaN         NaN   NaN   NaN   NaN   NaN   NaN   NaN\n",
       "9  9.0     Huey McDuck  52.0      189lbs     -     -     -    68    75    72"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "651172ed",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>10.00000</td>\n",
       "      <td>9.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>5.50000</td>\n",
       "      <td>36.333333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.02765</td>\n",
       "      <td>17.748239</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.00000</td>\n",
       "      <td>12.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>3.25000</td>\n",
       "      <td>19.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>5.50000</td>\n",
       "      <td>34.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>7.75000</td>\n",
       "      <td>52.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>10.00000</td>\n",
       "      <td>56.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             id        age\n",
       "count  10.00000   9.000000\n",
       "mean    5.50000  36.333333\n",
       "std     3.02765  17.748239\n",
       "min     1.00000  12.000000\n",
       "25%     3.25000  19.000000\n",
       "50%     5.50000  34.000000\n",
       "75%     7.75000  52.000000\n",
       "max    10.00000  56.000000"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "81807da3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 11 entries, 0 to 10\n",
      "Data columns (total 10 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   id      10 non-null     float64\n",
      " 1   name    10 non-null     object \n",
      " 2   age     9 non-null      float64\n",
      " 3   weight  9 non-null      object \n",
      " 4   m0006   10 non-null     object \n",
      " 5   m0612   10 non-null     object \n",
      " 6   m1218   10 non-null     object \n",
      " 7   f0006   10 non-null     object \n",
      " 8   f0612   9 non-null      object \n",
      " 9   f1218   10 non-null     object \n",
      "dtypes: float64(2), object(8)\n",
      "memory usage: 1008.0+ bytes\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "3eeb405f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False    9\n",
       "True     2\n",
       "Name: age, dtype: int64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['age'].isnull().value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f2b5eda8",
   "metadata": {},
   "outputs": [],
   "source": [
    "df[['first_name','last_name']] = df['name'].str.split(\" \",expand=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f5d41a94",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>name</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>Mickéy Mousé</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>Donald Duck</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>Mini Mouse</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>Scrooge McDuck</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>Pink Panther</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id            name   age      weight m0006 m0612 m1218 f0006 f0612 f1218  \\\n",
       "0  1.0    Mickéy Mousé  56.0       70kgs    72    69    71     -     -     -   \n",
       "1  2.0     Donald Duck  34.0   154.89lbs     -     -     -    85    84    76   \n",
       "2  3.0      Mini Mouse  16.0         NaN     -     -     -    65    69    72   \n",
       "3  4.0  Scrooge McDuck   NaN       78kgs    78    79    72     -     -     -   \n",
       "4  5.0    Pink Panther  54.0  198.658lbs     -     -     -    69   NaN    75   \n",
       "\n",
       "  first_name last_name  \n",
       "0     Mickéy     Mousé  \n",
       "1     Donald      Duck  \n",
       "2       Mini     Mouse  \n",
       "3    Scrooge    McDuck  \n",
       "4       Pink   Panther  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "8e023a97",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.drop('name',axis=1,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "f6358864",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age      weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0  1.0  56.0       70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1  2.0  34.0   154.89lbs     -     -     -    85    84    76     Donald   \n",
       "2  3.0  16.0         NaN     -     -     -    65    69    72       Mini   \n",
       "3  4.0   NaN       78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4  5.0  54.0  198.658lbs     -     -     -    69   NaN    75       Pink   \n",
       "\n",
       "  last_name  \n",
       "0     Mousé  \n",
       "1      Duck  \n",
       "2     Mouse  \n",
       "3    McDuck  \n",
       "4   Panther  "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "e9f36787",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>154.89lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>198.658lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>189lbs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    id   age      weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "1  2.0  34.0   154.89lbs     -     -     -    85    84    76     Donald   \n",
       "4  5.0  54.0  198.658lbs     -     -     -    69   NaN    75       Pink   \n",
       "5  6.0  52.0      189lbs     -     -     -    68    75    72       Huey   \n",
       "9  9.0  52.0      189lbs     -     -     -    68    75    72       Huey   \n",
       "\n",
       "  last_name  \n",
       "1      Duck  \n",
       "4   Panther  \n",
       "5    McDuck  \n",
       "9    McDuck  "
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lbs_df = df[df['weight'].str.contains('lbs').fillna(False)]\n",
    "lbs_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "a8191109",
   "metadata": {},
   "outputs": [],
   "source": [
    "lbs_to_kgs = lbs_df['weight'].map(lambda x:\"%.2fkgs\" % (float(x[:-3])/2.2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "daa5f19b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    70.40kgs\n",
       "4    90.30kgs\n",
       "5    85.91kgs\n",
       "9    85.91kgs\n",
       "Name: weight, dtype: object"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lbs_to_kgs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "83e0b6db",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.loc[lbs_to_kgs.index,'weight'] = lbs_to_kgs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "c34f6c34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Int64Index([1, 4, 5, 9], dtype='int64')"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lbs_to_kgs.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "840400ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0       NaN     -     -     -    65    69    72       Mini   \n",
       "3    4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "8    NaN   NaN       NaN   NaN   NaN   NaN   NaN   NaN   NaN        NaN   \n",
       "9    9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "8        NaN  \n",
       "9     McDuck  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "679af854",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.dropna(how='all',inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "f41f7ac1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0       NaN     -     -     -    65    69    72       Mini   \n",
       "3    4.0   NaN     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "9    9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "9     McDuck  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "34fcfb7e",
   "metadata": {},
   "outputs": [],
   "source": [
    "df['age'].fillna(30,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "509e894e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0       NaN     -     -     -    65    69    72       Mini   \n",
       "3    4.0  30.0     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "9    9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "9     McDuck  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "id": "59c1ce8d",
   "metadata": {},
   "outputs": [],
   "source": [
    "weight_mean = df['weight'].fillna('0kgs').apply(lambda x:float(x[:-3])).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "id": "84e00927",
   "metadata": {},
   "outputs": [],
   "source": [
    "df['weight'].fillna(\"%.2fkgs\" % weight_mean,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "id": "91217201",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>NaN</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0  65.95kgs     -     -     -    65    69    72       Mini   \n",
       "3    4.0  30.0     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69   NaN    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "9    9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "9     McDuck  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 70,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "3bf11bde",
   "metadata": {},
   "outputs": [],
   "source": [
    "df['f0612'].fillna(\"%d\" % (df[df['f0612'].fillna('-') != '-']['f0612'].astype('int').mean()),inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "id": "31d42899",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>79</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>9.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0  65.95kgs     -     -     -    65    69    72       Mini   \n",
       "3    4.0  30.0     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69    79    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "9    9.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "9     McDuck  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "9a5f7c8c",
   "metadata": {},
   "outputs": [],
   "source": [
    "df.drop_duplicates(['first_name','last_name','age','weight'],inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "699249b0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Mickéy</td>\n",
       "      <td>Mousé</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>79</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scööpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -     Mickéy   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0  65.95kgs     -     -     -    65    69    72       Mini   \n",
       "3    4.0  30.0     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69    79    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -     Scööpy   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0      Mousé  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "9962e566",
   "metadata": {},
   "outputs": [],
   "source": [
    "# [^\\x00-\\x7f]\n",
    "df['first_name'].replace({r\"[^\\x00-\\x7f]\":\"\"},regex=True,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "0fdbccd4",
   "metadata": {},
   "outputs": [],
   "source": [
    "df['last_name'].replace({r\"[^\\x00-\\x7f]\":\"\"},regex=True,inplace=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "2cb1d23b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>m0006</th>\n",
       "      <th>m0612</th>\n",
       "      <th>m1218</th>\n",
       "      <th>f0006</th>\n",
       "      <th>f0612</th>\n",
       "      <th>f1218</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>72</td>\n",
       "      <td>69</td>\n",
       "      <td>71</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>85</td>\n",
       "      <td>84</td>\n",
       "      <td>76</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>65</td>\n",
       "      <td>69</td>\n",
       "      <td>72</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>79</td>\n",
       "      <td>72</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>69</td>\n",
       "      <td>79</td>\n",
       "      <td>75</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>68</td>\n",
       "      <td>75</td>\n",
       "      <td>72</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>71</td>\n",
       "      <td>78</td>\n",
       "      <td>75</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>78</td>\n",
       "      <td>76</td>\n",
       "      <td>75</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>92</td>\n",
       "      <td>95</td>\n",
       "      <td>87</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight m0006 m0612 m1218 f0006 f0612 f1218 first_name  \\\n",
       "0    1.0  56.0     70kgs    72    69    71     -     -     -      Micky   \n",
       "1    2.0  34.0  70.40kgs     -     -     -    85    84    76     Donald   \n",
       "2    3.0  16.0  65.95kgs     -     -     -    65    69    72       Mini   \n",
       "3    4.0  30.0     78kgs    78    79    72     -     -     -    Scrooge   \n",
       "4    5.0  54.0  90.30kgs     -     -     -    69    79    75       Pink   \n",
       "5    6.0  52.0  85.91kgs     -     -     -    68    75    72       Huey   \n",
       "6    7.0  19.0     56kgs     -     -     -    71    78    75      Dewey   \n",
       "7    8.0  32.0     78kgs    78    76    75     -     -     -       Scpy   \n",
       "10  10.0  12.0     45kgs     -     -     -    92    95    87      Louie   \n",
       "\n",
       "   last_name  \n",
       "0       Mous  \n",
       "1       Duck  \n",
       "2      Mouse  \n",
       "3     McDuck  \n",
       "4    Panther  \n",
       "5     McDuck  \n",
       "6     McDuck  \n",
       "7        Doo  \n",
       "10    McDuck  "
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "fbb5af26",
   "metadata": {},
   "outputs": [],
   "source": [
    "sorted_columns = ['id','age','weight','first_name','last_name']\n",
    "df = pd.melt(df,\n",
    "             id_vars=sorted_columns,\n",
    "             var_name='sex_hour',\n",
    "             value_name='puls_rate').sort_values(['id','sex_hour'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "53bdca6a",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df[df['puls_rate'] != '-']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "id": "a7d2cb99",
   "metadata": {},
   "outputs": [],
   "source": [
    "def split_sex_hour(sex_hour):\n",
    "    # m0006\n",
    "    sex = sex_hour[:1]\n",
    "    if \"m\" == sex:\n",
    "        sex = \"男\"\n",
    "    elif \"f\" == sex:\n",
    "        sex = \"女\"\n",
    "    hour = sex_hour[1:]\n",
    "    return sex+\"-\"+hour"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "50d0cf8e",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\users\\zzk10\\python3.7.9\\lib\\site-packages\\pandas\\core\\frame.py:3641: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  self[k1] = value[k2]\n"
     ]
    }
   ],
   "source": [
    "df[['sex','hour']] = df['sex_hour'].apply(split_sex_hour).str.split(\"-\",expand=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "id": "92e25d93",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>age</th>\n",
       "      <th>weight</th>\n",
       "      <th>first_name</th>\n",
       "      <th>last_name</th>\n",
       "      <th>sex_hour</th>\n",
       "      <th>puls_rate</th>\n",
       "      <th>sex</th>\n",
       "      <th>hour</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>m0006</td>\n",
       "      <td>72</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>m0612</td>\n",
       "      <td>69</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1.0</td>\n",
       "      <td>56.0</td>\n",
       "      <td>70kgs</td>\n",
       "      <td>Micky</td>\n",
       "      <td>Mous</td>\n",
       "      <td>m1218</td>\n",
       "      <td>71</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>f0006</td>\n",
       "      <td>85</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>f0612</td>\n",
       "      <td>84</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>2.0</td>\n",
       "      <td>34.0</td>\n",
       "      <td>70.40kgs</td>\n",
       "      <td>Donald</td>\n",
       "      <td>Duck</td>\n",
       "      <td>f1218</td>\n",
       "      <td>76</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>f0006</td>\n",
       "      <td>65</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>f0612</td>\n",
       "      <td>69</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>3.0</td>\n",
       "      <td>16.0</td>\n",
       "      <td>65.95kgs</td>\n",
       "      <td>Mini</td>\n",
       "      <td>Mouse</td>\n",
       "      <td>f1218</td>\n",
       "      <td>72</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>m0006</td>\n",
       "      <td>78</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>m0612</td>\n",
       "      <td>79</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>4.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scrooge</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>m1218</td>\n",
       "      <td>72</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>f0006</td>\n",
       "      <td>69</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>f0612</td>\n",
       "      <td>79</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>5.0</td>\n",
       "      <td>54.0</td>\n",
       "      <td>90.30kgs</td>\n",
       "      <td>Pink</td>\n",
       "      <td>Panther</td>\n",
       "      <td>f1218</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0006</td>\n",
       "      <td>68</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0612</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>6.0</td>\n",
       "      <td>52.0</td>\n",
       "      <td>85.91kgs</td>\n",
       "      <td>Huey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f1218</td>\n",
       "      <td>72</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0006</td>\n",
       "      <td>71</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0612</td>\n",
       "      <td>78</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>7.0</td>\n",
       "      <td>19.0</td>\n",
       "      <td>56kgs</td>\n",
       "      <td>Dewey</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f1218</td>\n",
       "      <td>75</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>m0006</td>\n",
       "      <td>78</td>\n",
       "      <td>男</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>m0612</td>\n",
       "      <td>76</td>\n",
       "      <td>男</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>8.0</td>\n",
       "      <td>32.0</td>\n",
       "      <td>78kgs</td>\n",
       "      <td>Scpy</td>\n",
       "      <td>Doo</td>\n",
       "      <td>m1218</td>\n",
       "      <td>75</td>\n",
       "      <td>男</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0006</td>\n",
       "      <td>92</td>\n",
       "      <td>女</td>\n",
       "      <td>0006</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f0612</td>\n",
       "      <td>95</td>\n",
       "      <td>女</td>\n",
       "      <td>0612</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>10.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>45kgs</td>\n",
       "      <td>Louie</td>\n",
       "      <td>McDuck</td>\n",
       "      <td>f1218</td>\n",
       "      <td>87</td>\n",
       "      <td>女</td>\n",
       "      <td>1218</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "      id   age    weight first_name last_name sex_hour puls_rate sex  hour\n",
       "0    1.0  56.0     70kgs      Micky      Mous    m0006        72   男  0006\n",
       "9    1.0  56.0     70kgs      Micky      Mous    m0612        69   男  0612\n",
       "18   1.0  56.0     70kgs      Micky      Mous    m1218        71   男  1218\n",
       "28   2.0  34.0  70.40kgs     Donald      Duck    f0006        85   女  0006\n",
       "37   2.0  34.0  70.40kgs     Donald      Duck    f0612        84   女  0612\n",
       "46   2.0  34.0  70.40kgs     Donald      Duck    f1218        76   女  1218\n",
       "29   3.0  16.0  65.95kgs       Mini     Mouse    f0006        65   女  0006\n",
       "38   3.0  16.0  65.95kgs       Mini     Mouse    f0612        69   女  0612\n",
       "47   3.0  16.0  65.95kgs       Mini     Mouse    f1218        72   女  1218\n",
       "3    4.0  30.0     78kgs    Scrooge    McDuck    m0006        78   男  0006\n",
       "12   4.0  30.0     78kgs    Scrooge    McDuck    m0612        79   男  0612\n",
       "21   4.0  30.0     78kgs    Scrooge    McDuck    m1218        72   男  1218\n",
       "31   5.0  54.0  90.30kgs       Pink   Panther    f0006        69   女  0006\n",
       "40   5.0  54.0  90.30kgs       Pink   Panther    f0612        79   女  0612\n",
       "49   5.0  54.0  90.30kgs       Pink   Panther    f1218        75   女  1218\n",
       "32   6.0  52.0  85.91kgs       Huey    McDuck    f0006        68   女  0006\n",
       "41   6.0  52.0  85.91kgs       Huey    McDuck    f0612        75   女  0612\n",
       "50   6.0  52.0  85.91kgs       Huey    McDuck    f1218        72   女  1218\n",
       "33   7.0  19.0     56kgs      Dewey    McDuck    f0006        71   女  0006\n",
       "42   7.0  19.0     56kgs      Dewey    McDuck    f0612        78   女  0612\n",
       "51   7.0  19.0     56kgs      Dewey    McDuck    f1218        75   女  1218\n",
       "7    8.0  32.0     78kgs       Scpy       Doo    m0006        78   男  0006\n",
       "16   8.0  32.0     78kgs       Scpy       Doo    m0612        76   男  0612\n",
       "25   8.0  32.0     78kgs       Scpy       Doo    m1218        75   男  1218\n",
       "35  10.0  12.0     45kgs      Louie    McDuck    f0006        92   女  0006\n",
       "44  10.0  12.0     45kgs      Louie    McDuck    f0612        95   女  0612\n",
       "53  10.0  12.0     45kgs      Louie    McDuck    f1218        87   女  1218"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "68ea66c9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
